home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / update~4.z / update~4 / lib_stdio_notused_vsprintf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  653 b   |  37 lines

  1. /*                v s p r i n t f
  2.  *
  3.  * This function provides the same functionality as sprintf except
  4.  * that it uses varargs.h.
  5.  *
  6.  * Patchlevel 1.0
  7.  *
  8.  * Edit History:
  9.  * 03-Sep-1989    Changed to PUTC() since no chance of line buffering.
  10.  */
  11.  
  12. #include "stdiolib.h"
  13.  
  14. /*LINTLIBRARY*/
  15.  
  16. int vsprintf(buf, fmt, args)
  17.  
  18. char *buf;                /* output buffer */
  19. char *fmt;                /* format */
  20. va_list args;                /* argument list */
  21.  
  22. {
  23.   int v;                /* return value */
  24.   FILE f;                /* temporary file */
  25.  
  26.   f._flag   = _IOWRITE | _IOSTRING;
  27.   f._base   = (unsigned char *) buf;
  28.   f._bufsiz = 0;
  29.  
  30.   INITWRITEBUFFER(&f);
  31.  
  32.   v = vfprintf(&f, fmt, args);
  33.   (void) PUTC(0, &f);
  34.  
  35.   return v;
  36. }
  37.